#!/bin/bash

for  item   in  1 2 3 4 5  ; do
    echo   "item is $item"
done

echo  '-----------'
for  item  in  {1..5} ; do
    echo   "item is $item"
done

echo  "------------------------"
for  item   in   'shit'  'cao'  'fool'  ; do
    echo   "item is $item"
done



echo  "------------------------"
char_array=('a', 'b', 'c');
for  item   in   $char_array
do
    echo   "item is $item"
done


echo  "------------------------"
for item  in  ${char_array[*]}
do
    echo   "item is $item"
done



echo  "------------- Since you double quoted this, it will not word split, and the loop will only run once. -----------"
for item  in  "${char_array[*]}" ; do
    echo   "item is $item"
done




echo  "------------------------"
for item  in  "${char_array[@]}" ; do
    echo   "item is $item"
done


echo  "---------  file  list  is  ---------------"
for  item  in  $( ls  | grep  'chapter'    ) ; do
    echo   "item is $item"
done




